package com.douyin.video.service.impl;

import com.douyin.video.entity.DouyinVideo;
import com.douyin.video.mapper.DouyinVideoMapper;
import com.douyin.video.service.DouyinVideoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.douyin.video.view.DouyinVideoView;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * 抖音视频
 *
 *
 * @author djianfeng
 * @since 2018-08-27
 */
@Transactional
@Service
public class DouyinVideoServiceImpl extends ServiceImpl<DouyinVideoMapper, DouyinVideo> implements DouyinVideoService {
    @Autowired
    DouyinVideoMapper douyinVideoMapper;

    @Override
    public List<DouyinVideoView> getDouyinVideoViews(Page<DouyinVideoView> page, DouyinVideoView view) {
        page.setRecords(douyinVideoMapper.getDouyinVideoViews(page,view));
        return page.getRecords();
    }

	@Override
	public DouyinVideoView queryDouyinVideoByUrl(String url) {
		return douyinVideoMapper.queryDouyinVideoByUrl(url);
	}

	@Override
	public boolean delDouyinVideo(Long id) {
		return douyinVideoMapper.delDouyinVideo(id);
	}
}
